package br.edu.ufcg.unknown.lexico;

public class TokenTest extends UnknownTest {

	private Token token;

	public void testEhIdentificador() {
		token = new Token("AND", "t_ident", "t_and", true);

		assertTrue(token.ehIdentificador());
		assertTrue(token.ehPalavraReservada());
		assertFalse(token.ehOperador());
		assertFalse(token.ehParentisador());
		assertFalse(token.ehSinalDePontuacao());
	}

	public void testEhOperador() {
		token = new Token("+", "t_operador", "t_mais", true);
		assertTrue(token.ehOperador());
		assertTrue(token.ehPalavraReservada());
		assertFalse(token.ehIdentificador());
		assertFalse(token.ehParentisador());
		assertFalse(token.ehSinalDePontuacao());
	}

	public void testEhParentisador() {
		token = new Token(")", "t_parentisador", "t_fecha_par", true);
		assertTrue(token.ehParentisador());
		assertTrue(token.ehPalavraReservada());
		assertFalse(token.ehOperador());
		assertFalse(token.ehIdentificador());
		assertFalse(token.ehSinalDePontuacao());
	}

	public void testEhSinalDePontuacao() {
		token = new Token(";", "t_sinal_pontuacao", "t_pto_vgl", true);
		assertTrue(token.ehSinalDePontuacao());
		assertTrue(token.ehPalavraReservada());
		assertFalse(token.ehParentisador());
		assertFalse(token.ehOperador());
		assertFalse(token.ehIdentificador());
	}

}
